package com.hainingtong.user.entity;

import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.List;

@EqualsAndHashCode(callSuper = true)
@Data
public class UserWithRolesAndPermissions extends SysUser implements Serializable {
    public UserWithRolesAndPermissions(SysUser u) {
        this.setId(u.getId());
        this.setAvatar(u.getAvatar());
        this.setCtime(u.getCtime());
        this.setDateOfBirth(u.getDateOfBirth());
        this.setDisabled(u.isDisabled());
        this.setMtime(u.getMtime());
        this.setSex(u.getSex());
        this.setNickname(u.getNickname());
    }

    List<SysRole> roles;
    List<SysPermission> permissions;
}
